﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewRequest.aspx.cs" Inherits="ItemReim.NewRequest" %>

<%@ Register Src="../../Processes/ProcessControl/UserInfo.ascx" TagName="UserInfo"
    TagPrefix="ui" %>
<%@ Register Src="../../Processes/ProcessControl/ApprovalHistory.ascx" TagName="ApprovalHistory"
    TagPrefix="ah" %>
<%@ Register Src="../../Processes/ProcessControl/Attachments.ascx" TagName="Attachments"
    TagPrefix="attach" %>
<%@ Register Src="../../Processes/ProcessControl/ButtonList.ascx" TagName="ButtonList"
    TagPrefix="btn" %>
<!DOCType html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>项目费用报销</title>
    <link rel="Stylesheet" href="../../App_Themes/formValidator2.5/css/validationEngine.jquery.css" />
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script> 
    <script type="text/javascript">

        jQuery(document).ready(function () {
            jQuery("");
            //禁用带出信息控件的编辑事件
            $("#fld_COSTBELONG").keydown(function (event) {
                return false;
            });
            $("#fld_ITEMNO").keydown(function (event) {
                return false;
            });
            $("#fld_ITEMSCALE").keydown(function (event) {
                return false;
            });
            $("#fld_ITEMNAME").keydown(function (event) {
                return false;
            });
            //我的申请打开为label赋值
            $("#lblITEMNUMBER").text($("#fld_ITEMNUMBER").val());
            $("#lblAmount").text($("#fld_REIMAMOUNT").val());
            $("#lblUpper").text($("#fld_UPPER").val());

            //判断是否为我的申请
            //            var b = request('type');
            //            if (b == 'myrequest') {
            //                $("#mytable").find("tr").each(function (i, a) {

            //                    $(a).find("td").eq(4).find("input").css("display", "");
            //                });
            //            }
        })

        //金额转大写
        function ChangePay() {
            var sum = 0
            $("#mytable").find("tr:gt(0)").each(function (i, Etr) {
                sum += $(Etr).find("td").eq(6).find("input").val() - 0;
            });
            $("#lblAmount").text(sum);
            $("#fld_REIMAMOUNT").val(sum);
            $("#lblUpper").text(ChangeRMBToCH(sum.toString()));
            $("#fld_UPPER").val(ChangeRMBToCH(sum.toString()));
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="row">
            <ui:userinfo id="UserInfo1" processtitle="项目费用报销" tablename="PROC_ITEMREIM" tablenamedetail="PROC_ITEMREIM_DETAIL"
                runat="server"></ui:userinfo>
        </div>
        <div class="row">
            <table class="table table-condensed table-bordered">
                <tr>
                    <td class="banner" colspan="4">
                        详细信息
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        项目名称：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_ITEMNAME" runat="server" CssClass="validate[required]"></asp:TextBox>
                        <input id="btn_Find" type="button" value="查询" class="btn" onclick="selectItem('fld_COSTBELONG', 'fld_ITEMNO','fld_ITEMSCALE','fld_ITEMNAME')" />
                    </td>
                    <td class="td-label">
                        项目编号：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_ITEMNO" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        项目规模：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_ITEMSCALE" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        项目阶段：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:DropDownList ID="fld_ITEMCASE" runat="server" CssClass="validate[required]">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="前期">前期</asp:ListItem>
                            <asp:ListItem Value="在建">在建</asp:ListItem>
                            <asp:ListItem Value="质保">质保</asp:ListItem>
                            <asp:ListItem Value="代维-变电">代维-变电</asp:ListItem>
                            <asp:ListItem Value="代维-机组质保">代维-机组质保</asp:ListItem>
                            <asp:ListItem Value="代维-机组质保外">代维-机组质保外</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        成本归属：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_COSTBELONG" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        编号：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:Label ID="lblITEMNUMBER" runat="server" Text=""></asp:Label>
                        <asp:TextBox ID="fld_ITEMNUMBER" runat="server" Style="display: none;"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        报销金额：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:Label ID="lblAmount" runat="server" Text=""></asp:Label>
                        <asp:TextBox runat="server" ID="fld_REIMAMOUNT" Style="display: none;" money="money"
                            CssClass="validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label" style="vertical-align: middle;">
                        报销金额（大写）：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:Label ID="lblUpper" runat="server" Text=""></asp:Label>
                        <asp:TextBox runat="server" ID="fld_UPPER" Style="display: none;" CssClass="validate[required]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        账户名：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_ACCOUNT" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        开户行：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_BANK" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        银行卡号：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_BANKID" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        报销类型：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:DropDownList ID="fld_REPORTTYPE" runat="server" CssClass="validate[required]"
                            AutoPostBack="true">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="租车租房劳务类">租车租房劳务类</asp:ListItem>
                            <asp:ListItem Value="其它类">其它类</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        任务完成情况概述：
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:TextBox ID="fld_DESCRIBE" Width="87%" runat="server"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <table id="mytable" class="table table-condensed table-bordered tablerequired">
                <tr>
                    <th>
                        黏贴单编号
                    </th>
                    <th>
                        票据编号
                    </th>
                    <th>
                        起始时间
                    </th>
                    <th>
                        结束时间
                    </th>
                    <th>
                        类型
                    </th>
                    <th>
                        票据内容
                    </th>
                    <th>
                        金额
                    </th>
                    <th>
                        备注
                    </th>
                    <th>
                        <asp:Button ID="btnAdd" runat="server" Text="增加" CssClass="btn" CausesValidation="false"
                            OnClick="btnAdd_Click" />
                    </th>
                </tr>
                <asp:Repeater ID="fld_detail_PROC_ITEMREIM_DETAIL" OnItemCommand="fld_detail_PROC_ITEMREIM_DETAIL_ItemCommand"
                    runat="server">
                    <ItemTemplate>
                        <tr>
                            <td style="text-align: center;">
                                <asp:TextBox ID="fld_FORMID" Text='<%#Eval("FORMID") %>' runat="server" Style="display: none;
                                    text-align: center;"></asp:TextBox>
                                <asp:TextBox ID="fld_BILLNO" Text='<%#Eval("BILLNO") %>' runat="server" Width="80%"
                                    CssClass="validate[required]"></asp:TextBox>
                            </td>
                            <td style="text-align: center;">
                                <asp:TextBox ID="fld_NOTENO" Text='<%#Eval("NOTENO") %>' runat="server" Width="80%"
                                    CssClass="validate[required]"></asp:TextBox>
                            </td>
                            <td style="text-align: center;">
                                <asp:TextBox ID="fld_STARTDATE" Text='<%#Eval("STARTDATE") %>' runat="server" Width="80%"
                                    OnClick="WdatePicker()" CssClass="validate[required] Wdate"></asp:TextBox>
                            </td>
                            <td style="text-align: center;">
                                <asp:TextBox ID="fld_ENDDATE" Text='<%#Eval("ENDDATE") %>' runat="server" Width="80%"
                                    OnClick="WdatePicker()" CssClass="validate[required] Wdate"></asp:TextBox>
                            </td>
                            <td style="text-align: center;">
                                <asp:TextBox ID="txtTypes" runat="server" Text='<%#Eval("TYPE") %>' Style="display: none;"></asp:TextBox>
                                <asp:DropDownList ID="fld_TYPE" runat="server" CssClass="validate[required]">
                                    <asp:ListItem Value="">--请选择--</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="text-align: center;">
                                <asp:TextBox ID="fld_CONTENT" Text='<%#Eval("CONTENT") %>' runat="server" Width="80%"
                                    CssClass="validate[required]"></asp:TextBox>
                            </td>
                            <td style="text-align: center;">
                                <asp:TextBox ID="fld_AMOUNTDETAIL" Text='<%#Eval("AMOUNTDETAIL") %>' runat="server"
                                    Width="80%" CssClass="validate[required]" money="money" onblur="ChangePay()"></asp:TextBox>
                            </td>
                            <td style="text-align: center;">
                                <asp:TextBox ID="fld_REMARK" Text='<%#Eval("REMARK") %>' runat="server" Width="80%"
                                    CssClass="validate[required]"></asp:TextBox>
                            </td>
                            <td style="text-align: center;">
                                <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="btn" CommandName="del"
                                    OnClientClick="return confirm('确认删除？')" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
        </div>
        <div class="row">
            <attach:attachments id="Attachments1" runat="server"></attach:attachments>
        </div>
        <div class="row">
            <ah:approvalhistory id="ApprovalHistory1" showaction="false" runat="server"></ah:approvalhistory>
        </div>
        <div class="row">
        </div>
    </div>
    <btn:buttonlist id="ButtonList1" runat="server"></btn:buttonlist>
    <div style="display: none;">
    </div>
    </form>
</body>
</html>
